#include "PointBear.h"

QString COLUMN_NAME_X = "x";
QString COLUMN_NAME_Y = "y";

QString COLUMN_TYPE_X = "int";
QString COLUMN_TYPE_Y = "int";

PointBear::PointBear()
{
	m_object = new BBObject;
	m_object->setName( "Point" );
	m_object->setAttributeType( COLUMN_NAME_X, COLUMN_TYPE_X );
	m_object->setAttributeType( COLUMN_NAME_Y, COLUMN_TYPE_Y );
	m_object->setAttributePrimitiveValue( COLUMN_NAME_X, NULL );
	m_object->setAttributePrimitiveValue( COLUMN_NAME_Y, NULL );
	addObject( m_object );
}

int PointBear::getX()
{
	return m_object->getAttributePrimitiveValue( COLUMN_NAME_X ).toInt();
}

void PointBear::setX( int value )
{
	m_object->setAttributePrimitiveValue( COLUMN_NAME_X, value );
}

// Y get/set
int PointBear::getY()
{
	return m_object->getAttributePrimitiveValue( COLUMN_NAME_Y ).toInt();
}

void PointBear::setY( int value )
{
	m_object->setAttributePrimitiveValue( COLUMN_NAME_Y, value );
}
